﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DeathExplode : MonoBehaviour {

   
    [SerializeField, Tooltip("获取死亡爆炸效果")]
    private GameObject explode;
    private Entity entity;//entity组件
    private void Start()
    {
        entity = GetComponent<Entity>();//初始化
        entity.OnDeath += Explode;//添加事件
    }
    public void Explode()
    {
        if(explode != null)
        GameObject.Instantiate(explode,transform.Find("Animation").position+new Vector3(0,0,-10), Quaternion.identity);
    }
}
